(vl-load-com)
(if (or	 (eq (getenv "RunNavvcubeOff") nil)
	 (eq (getenv "RunNavvcubeOff") ""))
  (setenv "RunNavvcubeOff" "1")
)
(defun reactor-navvcube  (reactor params)
  (if (eq (getenv "RunNavvcubeOff") "1")
    (progn
      (if (not
	     (wcmatch
	       (getvar "cmdnames")
	       "UNDO,U,REDO,OOPS,STYLE,COPYCLIP,COPYBASE,CUTCLIP"))
	 (progn
	   (if (and
		 (wcmatch (strcase (car params)) "MSPACE,PSPACE,ZOOM,TILEMODE")
	       )
	     (progn
	       ;;(alert "Here we can turn the NAVVCUBEDISPLAY off!...")
               (if (= 1 (getvar "tilemode"))(setvar "navvcubedisplay" 0))
               (if (AND
                     (= 0 (getvar "tilemode"))
                     (>=(GETVAR "CVPORT")1)
                   )
                 (setvar "navvcubedisplay" 0)
               )
             )
          )
        )
      )
    )
  )
)












(vlr-command-reactor "RunNavvcubeOff" '((:vlr-commandEnded . endCommand)))
 
(defun endCommand (calling-reactor endcommandInfo / thecommandend)
 (setq thecommandend (nth 0 endcommandInfo))
 (cond
 ((= thecommandend "MSPACE") (setvar "navvcubedisplay" 0))
 ((= thecommandend "TILEMODE") (if (= 1 (getvar "tilemode"))(setvar "navvcubedisplay" 0)))
 );end cond
 );end defun